﻿using System;
using System.Collections.Generic;
using GraphProcessor;
using IQIGame.Onigao.Logic;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay.Editors
{
    [System.Serializable, NodeMenuItem(SkillEditorConst.SkillEffective + "/" + SkillEditorConst.Package, typeof(SkillEditorGraph))]
    public class SkillEffectiveNode_Package : SkillEffectiveNode
    {
        protected override ESkillEffectiveType effectType => ESkillEffectiveType.Package;

        [Output("效果节点", false)] public SkillEditorActionNode actions;

        protected override void Process()
        {
            base.Process();
            this.actions = new SkillEditorActionNode()
            {
                packageConfig = this.selfConfig.customConfig as SkillEffective_Package_ConfigData
            };
        }

        protected override SkillCustomConfig CreateConfig()
        {
            var rConfig = new SkillEffective_Package_ConfigData()
            {
                actions = new List<SkillActionNode>()
            };
            return rConfig;
        }
    }

    public class SkillEditorActionNode
    {
        public SkillEditorActionNode last;
        public SkillEditorActionNode next;

        public SkillEffective_Package_ConfigData packageConfig;
        public SkillEffective_PrefabSource_ConfigData prefabConfig;

        public Action<SkillActionNode> setter;
        
        public SkillActionNode action;
    }
}